<template>
<!-- 单据表头 -->
  <a-form-model layout="inline" :model="form" v-bind="formItemLayout">
    <a-form-model-item
      v-for="(item, index) in cardDatas"
      :key="index"
      :required="item.required"
      :label="item.type !== 'CheckEdit' ? item.label: ''">
      <card-item v-model="cardDatas[index]" :source="source" stateName="dataList"/>
    </a-form-model-item>
  </a-form-model>
</template>
<script>
import cardItem from '@/components/middleware/CardComponentsItem'
import { mapState } from 'vuex'
export default {
  components: {
    cardItem
  },
  data () {
    return {
      source: 'card', // 数据来源
      form: this.$form.createForm(this, { name: 'coordinated' }),
      formItemLayout: {}
    }
  },
  computed: {
    ...mapState({
      'cardDatas': state => state.card.dataList
    })
  }
}
</script>
